<template>
  <div class="userCard border-card">
    <div class="baseInfo border-card">
      <img class="avatar" :src="userInfo.avatar" />
      <span class="username">{{ userInfo.username }}</span>
      <span class="desc">逻辑会把你从A带到B，想象力能带你...</span>
    </div>
    <div class="newList border-card">
      <p>最新作品</p>
      <div class="newListImgs">
        <img
          src="https://blog.quancundexiwang.wang/upload/2023/02/image-1676680353316.png"
          alt=""
        />
        <img
          src="https://blog.quancundexiwang.wang/upload/2023/02/image-1676680353316.png"
          alt=""
        />
        <img
          src="https://blog.quancundexiwang.wang/upload/2023/02/image-1676680353316.png"
          alt=""
        />
      </div>
    </div>
    <div class="newList border-card">
      <p>TAGS</p>
      <div class="newListImgs">
        <NButton secondary type="primary">NIKON Z62</NButton>
        <NButton secondary type="primary">CANON M50</NButton>
        <NButton secondary type="primary">SIGMA 50 F1.8</NButton>
        <NButton secondary type="primary">风景</NButton>
        <NButton secondary type="primary">5-200MM</NButton>
        <NButton secondary type="primary">星光</NButton>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { IUserProfile } from "~/api/user/types";
import { NButton, NCarousel } from "naive-ui";

interface IUserCardProps {
  userInfo: IUserProfile;
}

const props = withDefaults(defineProps<IUserCardProps>(), {
  userInfo: () => {
    return {
      user_id: 0,
      username: "",
      avatar: "",
      email: "",
      gender: 0,
    };
  },
});
</script>

<style scoped lang="scss">
.userCard {
  .baseInfo {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  z-index: 1;
  overflow: hidden;

  &::after {
    content: "";
    display: block;
    width: 100%;
    height: 80%;
    background: linear-gradient(
      180deg,
      var(--layout-background) 0%,
      var(--layout-background) 32%,
      rgba(147, 210, 210, 0) 100%
    );
    position: absolute;
    border-radius: 60px;
    top: -30%;
  }

  .username {
    font-size: 22px;
    font-weight: bold;
    margin: 10px 0;
  }

  .avatar {
    border-radius: 50%;
    width: 50%;
  }

  .desc {
    font-size: 12px;
    transform: scale(0.8);
    margin: 5px 0;
  }

  .dataArea {
    display: flex;
    margin-top: 5px;

    .dataAreaItem {
      border: 1px dashed darkblue;
      margin: 0 3px;
      background-color: #4f4a8e;
      color: #fff;
      text-align: center;
      border-radius: 12px;
      font-size: 12px;
      padding: 3px 5px;
    }
  }

  .newList {
    margin-top: 10px;
    p {
      font-size: 15px;
      margin: 10px 0;
    }

    .newListImgs {
      display: flex;
      flex-wrap: wrap;

      img {
        width: 30%;
        margin: 3px;
      }
    }
  }
}
</style>
